/**
 * tarside-ftp -- A simple FTP client, using the ANSI C and GTK+.
 * Copyright (C) 2011  degui.chen <degui.chen@qq.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include "ftp.h"
gint main_width = 0;
gint main_height = 0;
GtkWidget *main_window;

void local_remote(GtkWidget *paned) {
	GtkWidget *paned1 = gtk_hpaned_new();/*创建纵向分栏窗口构件*/
	gtk_widget_set_size_request(paned1, 0, main_height / 1.8);
	gtk_container_add(GTK_CONTAINER(paned), paned1);/*将分栏窗口构件加入窗体*/
	gtk_widget_show(paned1);
	local(paned1);
	remote(paned1);
}

void content_pane(GtkWidget *paned) {
	GtkWidget *paned1 = gtk_vpaned_new();/*创建纵向分栏窗口构件*/

	gtk_container_add(GTK_CONTAINER(paned), paned1);/*将分栏窗口构件加入窗体*/
	gtk_widget_show(paned1);

	local_remote(paned1);

	//upload_info(paned1);
}
void demo(GtkWidget *window) {
	GtkWidget *paned = gtk_vpaned_new();/*创建纵向分栏窗口构件*/
	login(paned);
	content_pane(paned);
	gtk_container_add(GTK_CONTAINER(window), paned);/*将分栏窗口构件加入窗体*/
	gtk_widget_show(paned);
}
int main(int argc, char *argv[]) {
	gtk_init(&argc, &argv);
	main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_maximize(GTK_WINDOW(main_window));//最大化
	GdkScreen* screen = gdk_screen_get_default();
	main_width = gdk_screen_get_width(screen);
	main_height = gdk_screen_get_height(screen);
	printf("main_width %i , main_height %i ", main_width, main_height);
	demo(main_window);

	g_signal_connect_swapped(G_OBJECT(main_window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
	gtk_widget_show_all(main_window);
	gtk_main();
	return 0;
}
